package com.xiaoluo.a19_zxing;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;

import com.uuzuche.lib_zxing.activity.ZXingLibrary;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    private QRCodeGlobalWindow mWindow;
    private int code = 131231312;
    private ScreenLoadingDialog mDialog;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ZXingLibrary.initDisplayOpinion(this);
        UiUtil.init(this);

      //  mWindow = new QRCodeGlobalWindow(this);

        Button addBtn = findViewById(R.id.addBtn);
        Button removeBtn = findViewById(R.id.remove);
        Button updateBtn = findViewById(R.id.update);
        Button isShowBtn = findViewById(R.id.isShow);

        addBtn.setOnClickListener(new View.OnClickListener() {


            @Override
            public void onClick(View v) {
                code++;
             //   mWindow.showWindow(code + "");
                mDialog = new ScreenLoadingDialog(MainActivity.this);
                mDialog.show("", "test sss");

            }
        });

        updateBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           //     mWindow.updateWindow("56435467123123");
                mDialog.dismiss();
            }
        });

        removeBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            //    mWindow.dismissWindow();
            }
        });

        isShowBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
         //       boolean isShow = mWindow.isShowing();
         //       Log.i(TAG, "onClick: isShow = " + isShow);
            }
        });

    }


}
